Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaffold for Statistics block on Landing pages #4261

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

leenagupte
Copy link
Contributor

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

Attempts to model CSV data for a new statistics block on landing pages

Why

Trello card

How

Screenshots?

@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 9, 2024 11:50 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-data-statistics-scaffold branch from a842149 to e64d5a5 Compare October 9, 2024 12:13
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 9, 2024 12:13 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-data-statistics-scaffold branch from e64d5a5 to ce72256 Compare October 9, 2024 12:48
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 9, 2024 12:48 Inactive
@govuk-ci govuk-ci had a problem deploying to govuk-frontend-app-pr-4261 October 15, 2024 15:24 Failure
@andysellick andysellick force-pushed the landing-pages-backend-data-statistics-scaffold branch from 954bc77 to 6ca4b44 Compare October 17, 2024 14:43
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 17, 2024 14:44 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 18, 2024 13:13 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 18, 2024 13:20 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 18, 2024 15:48 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-data-statistics-scaffold branch from f49841e to 27996d2 Compare October 18, 2024 16:05
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 18, 2024 16:06 Inactive
Statistics data will be read in from a CSV to be provided by departments
and then converted into a chart in the statistics block on landing
pages.

It is assumed that users will not need to be able to download the CSV
files directly and that a link will be provided to an externally hosted
data source, e.g. ONS data.
@leenagupte leenagupte force-pushed the landing-pages-backend-data-statistics-scaffold branch from 27996d2 to 0f9111c Compare October 18, 2024 16:16
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4261 October 18, 2024 16:16 Inactive
leenagupte and others added 9 commits October 18, 2024 17:28
It's unclear exactly how the data from the CSV files will be used to
display the graphs, so for the moment the unmodified rows are just being
returned.
The block should render twice as two statistics have been added to the
sample content item data.
A new "rows" method will be created in the next commit
Divides the rows method to a small public rows method and a private
`row_lines` method. This allows further refactoring without having to
change the tests.

Use a map rather than an each in rows method to make the method
slightly smaller. `each_with_index` has been replaced with
`each_with_object` for the same reason.

The CSV rows are being returned with symbol keys to that `to_sym`
doesn't need to be used in multiple places.

Finally, the row keys and values are being obfuscated.

We can't guarantee what the keys will be named so it's better not to
rely on them.

We're still assuming that each row will have 3 columns:

- x-axis value
- variable / line name
- y-axis value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants